/**********************************************************************
**                                                                   **
**                I N T E L   P R O P R I E T A R Y                  **
**                                                                   **
**   COPYRIGHT (c)  2005-2006         BY  INTEL  CORPORATION.  ALL   **
**   RIGHTS RESERVED.   NO PART OF THIS PROGRAM OR PUBLICATION MAY   **
**   BE  REPRODUCED,   TRANSMITTED,   TRANSCRIBED,   STORED  IN  A   **
**   RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY LANGUAGE OR COMPUTER   **
**   LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL,   **
**   MAGNETIC,  OPTICAL,  CHEMICAL, MANUAL, OR OTHERWISE,  WITHOUT   **
**   THE PRIOR WRITTEN PERMISSION OF :                               **
**                                                                   **
**                      INTEL  CORPORATION                           **
**                                                                   **
**                2200 MISSION COLLEGE BOULEVARD                     **
**                                                                   **
**             SANTA  CLARA,  CALIFORNIA  95052-8119                 **
**                                                                   **
**********************************************************************/

var Results		= new Array();
var URLTarget	= "_blank";
var Document	= document;
var PathDiv		= "\\";

var SearchList	= new Array();
var ExcludeList	= new Array();
var CurEntries	= new Array();

function Search()
{
	if (arguments.length == 0)				return; 
	if (typeof Array.prototype.splice == "undefined")	Array.prototype.splice = Splice_Fcn;

	if (typeof navigator.userAgent != "undefined")
	{
		var browser		= navigator.userAgent.toLowerCase();
		if ((browser.indexOf("netscape") == -1) &&  
			(browser.indexOf("firefox") == -1) && 
			(browser.indexOf("gecko") == -1))
				URLTarget="_self";
	}

	if (typeof window.location.pathname != "undefined")
	{
		var nIdx	= window.location.pathname.indexOf('/');
		if (nIdx != -1)	PathDiv = "/";
	}

	ClearArrays();
	var Exclude_Warning	= "";
	var FrameCnt		= top.frames.length;

	if (FrameCnt != 0)	Document = top.frames[FrameCnt-1].document;

	for (i=0; i < arguments.length; i++)
	{
		if (arguments[i].toString().indexOf(" ") == -1)
			AddToSearchArray(arguments[i].toString());
		else
		{
			var arg_array = arguments[i].toString().split(" ");
			for (j=0; j < arg_array.length; j++)
			{
				var current	= arg_array[j];
				if (current == "")	continue;
				if ((current == "+") || (current == "-"))
				{
					var next	= arg_array[++j];
					while ((next == "") && (j < arg_array.length+1))		next = arg_array[++j];
					current	= current + next;
				}
				AddToSearchArray(current);
			}
		}
	}
	Document.clear();
	Document.write("<html>");
	Document.write("<head>");
	Document.write("<meta http-equiv=Content-Type content=text/html>");
	Document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">");
	Document.write("</head>");
	Document.write("<body>");
	Document.title		= "Search Results";
	Document.write("<h1>Search Results</h1>");
	Document.write("<HR>");
	Document.write("<BR>");

	if (ExcludeList.length != 0)
	{
		for (j=0; j < Entries.length; j++)
		{
			var ExcCount = 0;
			for (i=0; i < ExcludeList.length; i++)
			{
				ExcCount += GetEntryCount(Entries[j], ExcludeList[i]);
				if (ExcCount != 0)		break;
			}
			if (ExcCount == 0)			CurEntries[CurEntries.length] = Entries[j];
		}
	}
	else		CurEntries	= Entries;

	for (i=0; i < SearchList.length; i++)
	{
		if (Exclude.indexOf(SearchList[i]) != -1)
		{
			if (Exclude_Warning	!= "")		Exclude_Warning	+= ", ";
			Exclude_Warning	+= SearchList[i];
		}
		else
		{
			FindString(SearchList[i]);
		}	
	}

	if ((SearchList.length == 0) && (ExcludeList.length != 0))		FindString("*");

	if (Exclude_Warning != "")
	{
		Document.write("<BR><BR><b>" + Exclude_Warning + "</b>");
		if (Exclude_Warning.indexOf(",") != -1)		Document.write(" are common words and were ignored.<BR>");
		else						Document.write(" is a common word and was ignored.<BR>");
	}

	for (i=0; i < Results.length; i++)
	{
		Document.write("<BR>");
		WriteResult(Results[i][1], Results[i][0], Results[i][2]);
	}

	if (Results.length == 0)
	{
		var OutStr	= "";
		for (i=0; i < arguments.length; i++)
			OutStr += " " + arguments[i];
		Document.write("<BR>");
		Document.write("Your search - <b>" + OutStr + "</b> - did not match any documents.");
		Document.write("<BR><BR>Suggestions:<BR>  - Make sure all words are spelled correctly.<BR>  - Try different keywords<BR>  - Try more general keywords<BR>");
	}

	Document.write("</body>");
	Document.write("</html>");
	Document.close();
	ClearArrays();
}
function AddToSearchArray(str)
{
	if (str.indexOf("+") != -1)
	{
		var	len	= SearchList.length;
		if (len != 0)			{	len--;	SearchList[len]	= SearchList[len] + str;	}
		else					SearchList[0]		= str;
	}
	else if (str.indexOf("-") == 0)
	{
		str	= str.substring(1, str.length);
		ExcludeList[ExcludeList.length]	= str;
	}
	else		SearchList[SearchList.length]	= str;
}
function WriteResult(page_name, page_url, description)
{
	if (arguments.length != 3)
	{
		return null;
	}

	if (description == "") 		description = "No description available";

	if ((PathDiv == "/") && (page_url.indexOf("\\") != -1))
		page_url	= 	page_url.replace("\\", "/");

	Document.write("<BR><b><a href=\""+page_url+"\" target=\"" + URLTarget + "\">"+page_name+"</a></b>");
	Document.write("<BR>" + description);
}
function FindString(str)
{
	for (j=0; j < CurEntries.length; j++)
	{
		var Count = 0;
		if (str == "*")		Count += 1;
		Count +=			GetEntryCount(CurEntries[j], str);
		if (Count != 0)		AddToResults(CurEntries[j][0], CurEntries[j][1], CurEntries[j][2], Count);
	}
}
function GetEntryCount(theEntry, str)
{
	if (theEntry.length != 5)	return 0;
	str	= str.toLowerCase();
	var Count = 0;
	if (str.indexOf("+") != -1)
	{
		var str_array = str.split("+");
		var c1			= GetEntryCount(theEntry, str_array[0])
		var c2			= GetEntryCount(theEntry, str.replace(str_array[0] + "+", ""));
		if ((c1 != 0) && (c2 != 0))		Count	= c1 + c2;
	}
	if (theEntry[1].toLowerCase().indexOf(str) != -1)
		Count += 8;
	if (theEntry[2].toLowerCase().indexOf(str) != -1)
		Count += 5;
	if (theEntry[3].indexOf(str) != -1)
		Count += 10;
	if (theEntry[4].indexOf(str) != -1)
		Count += 1;
	return Count;
}
function AddToResults(url, name, desc, count)
{
	for (k=0; k < Results.length; k++)
	{
		if (Results[k][0] == url)
		{
			count = Results[k][3] + count;
			Results.splice(k, 1);
			break;
		}
	}

	var NewIdx = Results.length;

	for (l=0; l < Results.length; l++)
	{
		if (Results[l][3] <= count)
		{
			NewIdx = l; break;
		}	
	}

	var NewEntry	= new Array(4);
	NewEntry[0] 	= url;
	NewEntry[1] 	= name;
	NewEntry[2]		= desc;
	NewEntry[3] 	= count;
	Results.splice(NewIdx, 0, NewEntry);
}
function Splice_Fcn()
{
	if (arguments.length < 2)			return;

	var InsertIdx	= arguments[0];
	var Count		= arguments[1];

	var tmp			= new Array();
	var	ModArray	= new Array();
	var i			= 0;

	for (i = 0; i < InsertIdx; i++)                     tmp[tmp.length] = this[i];
	for (i = 2; i < arguments.length; i++)              tmp[tmp.length] = arguments[i];
	for (i = InsertIdx + Count; i < this.length; i++)   tmp[tmp.length] = this[i];
	for (i = 0; i < tmp.length; i++)                    this[this.length] = tmp[i];

	return ModArray;
}
function ClearArrays()
{
	Results			= new Array();
	SearchList		= new Array();
	ExcludeList		= new Array();
	CurEntries		= new Array();
}


var Exclude             = "a add all also an and and/or are as at be but by can did do for from has have how id if in into is it no non not of on once one only onto or so some than that the this to too try two use want well what when where which why will with within yes you your";
var Entries             = new Array();

Entries[0]            = new Array(4);
Entries[0][0]         = "ad_100s.htm";
Entries[0][1]         = "Supported Adapters Server Pro/100";
Entries[0][2]         = "Supported Intel PRO/100 Server This driver software is designed to operate with the following Intel PRO/100 server adapters Product Name Board ID # Controller Intel ...";
Entries[0][3]         = "adapters connections software";
Entries[0][4]         = "a56831 adapter barcode board card code controller designed digit driver dual extension following front guide intel last modified name operate port printed pro/100 product revision see server software sticker supported xxx";

Entries[1]            = new Array(4);
Entries[1][0]         = "ipmi.htm";
Entries[1][1]         = "IPMI Manageability";
Entries[1][2]         = "IPMI Manageability Overview The Intelligent Platform Management Interface IPMI allows you to monitor server physical health characteristics, such as temperature, voltage, fans, power supplies, and ...";
Entries[1][3]         = "ians intelligent interface ipmi management platform tco-enabled teaming";
Entries[1][4]         = "above adapter adaptive address aggregation allows any asset balancing baseboard based bmc capabilities characteristics chassis configure connected connection controller dedicated device does due dynamic enabled enables fact fans functional health however ians ieee information intelligent interface intrusion ipmi last like link load lose mac manageability management mentioned modified monitor must need network overview pass physical plan platform port power provide receive recovery requirements restricted revision same server single sla specific static such supplies system tco team temperature these tracking traffic type vlan voltage";

Entries[2]            = new Array(4);
Entries[2][0]         = "reg100s.htm";
Entries[2][1]         = "Regulatory Information";
Entries[2][2]         = "Regulatory Information Intel PRO/100 S Server Adapter Intel PRO/100 S Dual Port Server Adapter Intel PRO/100+ Server Adapter Safety Compliance UL 60950 1 2001 First ...";
Entries[2][3]         = "";
Entries[2][4]         = "accept accordance adapter against amendment antenna any as/nzs3548 australia/new australian authority based been below between bsmi c22 can/csa canada canadian cause caution ce certification changed circuit cispr class classe cns13438 communications community compatibility compliance comply conditions conducted conformance conformity connect consult control corporation correct council dealer declaration declares described designed determined device different digital directive disturbance document does dual edition eec elam electromagnetic emc emi emissions ems en en55022 en55024 encouraged energy equipment european experienced fcc first following found frequency general generates guarantee harmful help her hillsboro his home however ices iec immunity including increase industry information installation installed instructions intel interference international japan jf3 korea last limits listed low mailstop manufacturer mark may measures mic modified more must ne nmb note notice occur off office operate outlet parkway part particular party permission phone port pro/100 product protection provide pursuant radiate radio radio/tv reasonable received receiver receiving reception recognition regulatory relocate reorient republic required requirements residential responsible revision rf rules safety separation server standards statement subject taiwan technician technology television tested there these tick turning ul undesired union upon usa user vcci verification void voltage without young zealand";

Entries[3]            = new Array(4);
Entries[3][0]         = "reqs.htm";
Entries[3][1]         = "System Requirements";
Entries[3][2]         = "System requirements for Intel PRO/100 Server adapters.";
Entries[3][3]         = "32-bit 64-bit compatibility install pci pci-x requirements";
Entries[3][4]         = "adapter advanced advantage available basic before bios bit bus check compatibility compatible computer configuration currently dos drivers either em64t extended following freebsd hardware hat higher ia-32 installed installer installing intel kernel last later latest linux list master memory met microsoft minimum mode modified must netware network novell open operating order pack pci platform pro/100 provided red requirements revision run sco server service slot software solaris sp2 sp5 sp7 sunsoft supplies support suse system takes technology unixware v2 vendor windows x64 xp";
